﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using TinyForum.Infrastructure.Validation;

namespace TinyForum.Web.Proxies.ServiceReference
{
    public class AccountDataObjectMetadata
    {
        [CustomRequired]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email")]
        [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage = "The Email is not in the correct format.")]
        public string Email { get; set; }

        [DataType(DataType.Text)]
        [StringLength(50, MinimumLength=1, ErrorMessage="Length should between 1 and 50.")]
        [CustomRequired]
        [Display(Name="Display Name")]
        public string DisplayName { get; set; }

        [DataType(DataType.Text)]
        [StringLength(100)]
        [CustomRequired]
        [Display(Name="Pwd. Question")]
        public string PasswordQuestion { get; set; }

        [DataType(DataType.Text)]
        [StringLength(100)]
        [CustomRequired]
        [Display(Name = "Pwd. Answer")]
        public string PasswordAnswer { get; set; }
    }

    [MetadataType(typeof(AccountDataObjectMetadata))]
    partial class AccountDataObject { }
}
